Remove trailing whitespace in source.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 28 Aug 2009 17:08:55 +0000 (17:08 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 28 Aug 2009 17:08:55 +0000 (17:08 +0000)
git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@3767 f51c46e8-681c-474f-0cfe-069cfd0219fb

18 files changed:
gpsbabel/gui/advdlg.cpp
gpsbabel/gui/dpencode.cpp
gpsbabel/gui/filterdata.cpp
gpsbabel/gui/filterdlg.cpp
gpsbabel/gui/filterwidgets.cpp
gpsbabel/gui/formatload.cpp
gpsbabel/gui/gmapdlg.cpp
gpsbabel/gui/gpx.cpp
gpsbabel/gui/help.cpp
gpsbabel/gui/latlng.cpp
gpsbabel/gui/main.cpp
gpsbabel/gui/mainwindow.cpp
gpsbabel/gui/mainwindow.h
gpsbabel/gui/map.cpp
gpsbabel/gui/optionsdlg.cpp
gpsbabel/gui/processwait.cpp
gpsbabel/gui/serial_mac.cpp
gpsbabel/gui/upgrade.cpp

index a98a4b683707776c5b499a24c704d952b4e3e27c..03d9e68d50ea406f279703a70ae8ac9ef219c2f2 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: advdlg.cpp,v 1.1 2009-07-05 21:14:56 robertl Exp $
+// $Id: advdlg.cpp,v 1.2 2009-08-28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -26,8 +26,8 @@
 #include "advdlg.h"
 
 //------------------------------------------------------------------------
-AdvDlg::AdvDlg(QWidget* parent, 
-              bool &synthShortNames, 
+AdvDlg::AdvDlg(QWidget* parent,
+              bool &synthShortNames,
               bool &forceGPSTypes,
               bool &enableCharSetXform,
               bool &previewGmap,
index ea4357877aa4a0969052e2233fe94884adff65f3..9bf889bbe5eab1941c1d76742a42b907dd6f357b 100755 (executable)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: dpencode.cpp,v 1.1 2009-07-05 21:14:56 robertl Exp $
+// $Id: dpencode.cpp,v 1.2 2009-08-28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Original in JavaScript: 
@@ -40,7 +40,7 @@ PolylineEncoder::PolylineEncoder(int numLevels, double zoomFactor, double vs):
 {
   if (verySmall <=0.0)
     verySmall = 1.0E-5;
-  for(int i = 0; i < numLevels; i++) 
+  for(int i = 0; i < numLevels; i++)
     zoomLevelBreaks.push_back(verySmall*pow(zoomFactor, numLevels-i-1));
 }
 
@@ -90,8 +90,8 @@ int roundToInt(double x) {
   return (x>0.0) ? int(x+0.5) : int(x-0.5);
 }
 //------------------------------------------------------------------------
-void PolylineEncoder::createEncodings(string &encoded_points, 
-                                     const vector <LatLng> &points, 
+void PolylineEncoder::createEncodings(string &encoded_points,
+                                     const vector <LatLng> &points,
                                      const vector <double> dists)
 {
   encoded_points = "";;
@@ -111,7 +111,7 @@ void PolylineEncoder::createEncodings(string &encoded_points,
 }
 
 //------------------------------------------------------------------------
-// This computes the appropriate zoom level of a point in terms of it's 
+// This computes the appropriate zoom level of a point in terms of it's
 // distance from the relevant segment in the DP algorithm.  Could be done
 // in terms of a logarithm, but this approach makes it a bit easier to
 // ensure that the level is not too large.
@@ -202,9 +202,3 @@ void PolylineEncoder::dpEncode(string &encPts, string &encLevels, const vector<L
   createEncodings(encPts, points, dists);
   encodeLevels(encLevels, points, dists);
 }
-
-
-
-
-
-
index d4e0308bb562c109acd6c731afc4ec9d7826d3ef..7915de0980ee13c9cc6edd5eb830842232d76083 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: filterdata.cpp,v 1.2 2009-07-31 18:32:32 robertl Exp $
+// $Id: filterdata.cpp,v 1.3 2009-08-28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -90,7 +90,7 @@ QStringList TrackFilterData::makeOptionString()
   if (merge)    s += ",merge";
   if (split && (pack || merge))  {
     s += ",split";
-    if (splitTime > 0) 
+    if (splitTime > 0)
       s += QString("=%1%2").arg(splitTime).arg("mhd"[splitTimeUnit]);
   }
   if (splitDist > 0) {
@@ -116,7 +116,7 @@ QStringList TrackFilterData::makeOptionString()
   if (move)     s += QString(",move=%1d%2h%3m%4s").arg(days).arg(hours).arg(mins).arg(secs);
   if (title)    s += QString(",title=%1").arg(titleString);
 
-  if (s.length()) 
+  if (s.length())
     args << "-x" << "track" + s;
 
   return args;
@@ -160,5 +160,3 @@ QStringList MiscFltFilterData::makeOptionString()
   }
   return args;
 }
-
-
index be801b450ffa45d5ca34d2e0e829903f38fd0fb7..6d25fc68edffb609fb86b39a6a4fcb4940a5b08c 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: filterdlg.cpp,v 1.1 2009-07-05 21:14:56 robertl Exp $
+// $Id: filterdlg.cpp,v 1.2 2009-08-28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -58,7 +58,7 @@ FilterDialog::FilterDialog(QWidget*parent, AllFiltersData &fd): QDialog(parent),
 
   connect(ui.helpButton, SIGNAL(clicked()), this, SLOT(helpX()));
   connect(ui.resetButton, SIGNAL(clicked()), this, SLOT(resetX()));
-  
+
 
   ui.buttonBox->button(QDialogButtonBox::Ok)->setIcon(QIcon(":images/ok"));
   ui.buttonBox->button(QDialogButtonBox::Cancel)->setIcon(QIcon(":images/cancel"));
@@ -71,7 +71,7 @@ FilterDialog::FilterDialog(QWidget*parent, AllFiltersData &fd): QDialog(parent),
 
 
 //------------------------------------------------------------------------
-void FilterDialog::addFilterPage(const QString &name, FilterWidget *fw, bool*use) 
+void FilterDialog::addFilterPage(const QString &name, FilterWidget *fw, bool*use)
 {
   QListWidgetItem *it = new QListWidgetItem(name);
   it->setCheckState(*use? Qt::Checked:Qt::Unchecked);
@@ -110,7 +110,7 @@ void FilterDialog::resetX()
       pages[i]->setWidgetValues();
       pages[i]->setEnabled(*(usePages[i]));
       pages[i]->checkChecks();
-      ui.filterList->item(i)->setCheckState(*(usePages[i]) ? Qt::Checked: Qt::Unchecked); 
+      ui.filterList->item(i)->setCheckState(*(usePages[i]) ? Qt::Checked: Qt::Unchecked);
     }
   }
 }
index c58193b5f1610f4906ced59756a799edc223dc70..eb88dc8523bf5f2731c3881cf101b4191a221691 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: filterwidgets.cpp,v 1.2 2009-07-31 18:32:32 robertl Exp $
+// $Id: filterwidgets.cpp,v 1.3 2009-08-28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -30,8 +30,8 @@ TrackWidget::TrackWidget(QWidget *parent, TrackFilterData &tfd): FilterWidget(pa
 
   // Checkbox interlocks
   addCheckEnabler(ui.titleCheck, ui.titleText);
-  addCheckEnabler(ui.moveCheck, 
-                 (QList<QWidget *> () 
+  addCheckEnabler(ui.moveCheck,
+                 (QList<QWidget *> ()
                   << ui.daysLabel << ui.daysSpin
                   << ui.hoursLabel<< ui.hoursSpin
                   << ui.minsLabel << ui.minsSpin
@@ -39,7 +39,7 @@ TrackWidget::TrackWidget(QWidget *parent, TrackFilterData &tfd): FilterWidget(pa
   addCheckEnabler(ui.startCheck,    ui.startEdit);
   addCheckEnabler(ui.stopCheck,     ui.stopEdit);
   addCheckEnabler(ui.GPSFixesCheck, ui.GPSFixesCombo);
-  
+
   connect(ui.mergeCheck, SIGNAL(clicked()) , this, SLOT(mergeCheckX()));
   connect(ui.splitCheck, SIGNAL(clicked()) , this, SLOT(OtherCheckX()));
   connect(ui.packCheck,  SIGNAL(clicked()),  this, SLOT(packCheckX()));
@@ -48,7 +48,7 @@ TrackWidget::TrackWidget(QWidget *parent, TrackFilterData &tfd): FilterWidget(pa
 
   ui.startEdit->setDisplayFormat("dd MMM yyyy hh:mm:ss AP");
   ui.stopEdit->setDisplayFormat("dd MMM yyyy hh:mm:ss AP");
-  
+
   // Collect the data fields.
   fopts << new BoolFilterOption(tfd.title,  ui.titleCheck);
   fopts << new BoolFilterOption(tfd.move,   ui.moveCheck);
@@ -88,7 +88,7 @@ void TrackWidget::OtherCheckX()
   bool bb = ui.packCheck->isChecked() &&ui.splitCheck->isChecked();
   ui.splitTimeSpin->setEnabled(bb);
   ui.splitTimeCombo->setEnabled(bb);
-  //ui.splitDistSpin->setEnabled(bb); 
+  //ui.splitDistSpin->setEnabled(bb);
   //ui.splitDistCombo->setEnabled(bb);
 }
 
index 21947db1286d735c9d70be97272fb38b93e1e05c..07aac20f8bae3b38f83eb0df385cf365ed358ed8 100644 (file)
@@ -1,5 +1,5 @@
 // -*- c++ -*-
-// $Id: formatload.cpp,v 1.1 2009-07-05 21:14:56 robertl Exp $
+// $Id: formatload.cpp,v 1.2 2009-08-28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -38,7 +38,7 @@ static QString xlt(const QString &f) {
 bool FormatLoad::skipToValidLine()
 {
   QRegExp regex("^(file|serial)");
-  while (currentLine <lines.size() && regex.indexIn(lines[currentLine]) != 0) 
+  while (currentLine <lines.size() && regex.indexIn(lines[currentLine]) != 0)
     currentLine++;
   return (currentLine<lines.size());
 }
@@ -73,16 +73,16 @@ bool FormatLoad::processFormat(Format &format)
       type = FormatOption::OPTstring;
     else if (optionType == "integer") {
       type = (optionMax != "" && optionMin != "") ? FormatOption::OPTboundedInt : FormatOption::OPTint;
-      if (optionMax == "") 
+      if (optionMax == "")
        optionMax = "2147483647";
-      if (optionMin == "") 
+      if (optionMin == "")
        optionMin = "-2147483647";
     }
     else if (optionType == "float") {
       type = FormatOption::OPTfloat;
-      if (optionMax == "") 
+      if (optionMax == "")
        optionMax = "1.0E308";
-      if (optionMin == "") 
+      if (optionMin == "")
        optionMin = "-1.0E308";
     }
     else if (optionType == "file") {
@@ -101,13 +101,13 @@ bool FormatLoad::processFormat(Format &format)
   }
   QList <FormatOption> optionList2 = optionList;
 
-  format = Format(hfields[2], xlt(hfields[4]), 
+  format = Format(hfields[2], xlt(hfields[4]),
                  hfields[1][0] == QChar('r'),  hfields[1][2] == QChar('r'),  hfields[1][4] == QChar('r'),
                  hfields[1][1] == QChar('w'),  hfields[1][3] == QChar('w'),  hfields[1][5] == QChar('w'),
                  hfields[0] == "file",
                  hfields[0] == "serial",
                  QStringList() << hfields[3],
-                 optionList,           
+                 optionList,
                  optionList2);
   return true;
 }
@@ -116,7 +116,7 @@ bool FormatLoad::processFormat(Format &format)
 bool FormatLoad::getFormats(QList<Format> &formatList)
 {
   formatList.clear();
-  
+
   QProcess babel;
   babel.start("gpsbabel", QStringList() << "-^3");
   if (!babel.waitForStarted())
@@ -124,7 +124,7 @@ bool FormatLoad::getFormats(QList<Format> &formatList)
   babel.closeWriteChannel();
   if (!babel.waitForFinished())
     return false;
-  if (babel.exitCode() != 0) 
+  if (babel.exitCode() != 0)
     return false;
 
   QTextStream tstream(babel.readAll());
@@ -144,13 +144,12 @@ bool FormatLoad::getFormats(QList<Format> &formatList)
     Format format;
     if (!processFormat(format)) {
       QMessageBox::information
-       (0, appName, 
+       (0, appName,
         QObject::tr("Error processing formats from running process \"gpsbabel -^3\" at line %1").arg(lineList[currentLine]));
-    } 
+    }
     else {
       formatList << format;
     }
   }
   return true;
 }
-
index 5c62f57628f804ca1cd646764610c65d514b8234..eb5adfe79f40c1479de19221e08f302698c95268 100755 (executable)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: gmapdlg.cpp,v 1.1 2009-07-05 21:14:56 robertl Exp $
+// $Id: gmapdlg.cpp,v 1.2 2009-08-28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -42,14 +42,14 @@ class StandardItem: public QStandardItem
 class TreeAction: public QAction
 {
 public:
-  TreeAction(const QString &text, 
+  TreeAction(const QString &text,
             QObject *obj, const char *member,  QObject *parent): QAction(text, parent)
   {
     connect(this, SIGNAL(triggered()), obj, member);
   }
 };
 //------------------------------------------------------------------------
-QString GMapDialog::formatLength(double l) 
+QString GMapDialog::formatLength(double l)
 {
   double metricLength = l;
   QString metricUnit = tr("meters");
@@ -59,7 +59,7 @@ QString GMapDialog::formatLength(double l)
     metricUnit = "km";
     metricPrecision = 3;
   }
-  
+
   double fpsLength = l*1000.0/25.4/12.0;
   QString fpsUnit = tr("feet");
   int fpsPrecision = 1;
@@ -73,7 +73,7 @@ QString GMapDialog::formatLength(double l)
                 .arg(metricUnit)
                 .arg(fpsLength, 0, 'f', fpsPrecision)
                 .arg(fpsUnit));
-  
+
 }
 //------------------------------------------------------------------------
 void GMapDialog::appendWaypointInfo(QStandardItem *it, const GpxWaypoint &wpt)
@@ -84,7 +84,7 @@ void GMapDialog::appendWaypointInfo(QStandardItem *it, const GpxWaypoint &wpt)
     it->appendRow(new StandardItem(tr("Desc: %1").arg(wpt.getDescription())));
   if (wpt.getComment() != QString() && wpt.getComment() != wpt.getDescription())
     it->appendRow(new StandardItem(tr("Cmt: %1").arg(wpt.getComment())));
-  if (wpt.getElevation() > -50000) 
+  if (wpt.getElevation() > -50000)
     it->appendRow(new StandardItem(tr("Ele: %1").arg(wpt.getElevation())));
 
 }
@@ -123,7 +123,7 @@ void GMapDialog::appendTrackInfo(QStandardItem *it, const GpxTrack &trk)
   it->appendRow(new StandardItem(tr("Points: %1").arg(count)));
 
   it->appendRow(new StandardItem(formatLength(trk.length())));
-  
+
 }
 
 //------------------------------------------------------------------------
@@ -145,7 +145,7 @@ GMapDialog::GMapDialog(QWidget *parent, const QString &gpxFileName, QPlainTextEd
   lay->addWidget(mapWidget);
 
   model = new QStandardItemModel(this);
-  
+
   wptItem = new StandardItem(tr("Waypoints"));
   wptItem->setCheckable(true);
   wptItem->setCheckState(Qt::Checked);
@@ -199,7 +199,7 @@ GMapDialog::GMapDialog(QWidget *parent, const QString &gpxFileName, QPlainTextEd
   connect(mapWidget, SIGNAL(waypointClicked(int)), this, SLOT(waypointClickedX(int)));
   connect(mapWidget, SIGNAL(routeClicked(int)), this, SLOT(routeClickedX(int)));
   connect(mapWidget, SIGNAL(trackClicked(int)), this, SLOT(trackClickedX(int)));
-  connect(ui.treeView, SIGNAL(doubleClicked(const QModelIndex &)), 
+  connect(ui.treeView, SIGNAL(doubleClicked(const QModelIndex &)),
          this, SLOT(treeDoubleClicked(const QModelIndex&)));
   connect(ui.treeView->selectionModel(), SIGNAL(selectionChanged (const QItemSelection &,  const QItemSelection &)),
          this, SLOT(selectionChangedX(const QItemSelection &,  const QItemSelection &)));
@@ -212,27 +212,27 @@ GMapDialog::GMapDialog(QWidget *parent, const QString &gpxFileName, QPlainTextEd
 }
 
 //-------------------------------------------------------------------------
-void GMapDialog::itemChangedX(QStandardItem *it) 
+void GMapDialog::itemChangedX(QStandardItem *it)
 {
   bool show = (it->checkState() == Qt::Checked);
   if (it == trkItem) {
-    if (show) 
+    if (show)
       mapWidget->showTracks(gpx.getTracks());
-    else 
+    else
       mapWidget->hideAllTracks();
   }
 
   else if (it == wptItem) {
     if (show)
       mapWidget->showWaypoints(gpx.getWaypoints());
-    else 
+    else
       mapWidget->hideAllWaypoints();
   }
 
   else if (it == rteItem) {
     if (show)
       mapWidget->showRoutes(gpx.getRoutes());
-    else 
+    else
       mapWidget->hideAllRoutes();
   }
 
@@ -258,13 +258,13 @@ void GMapDialog::itemChangedX(QStandardItem *it)
       }
     }
   }
-}  
+}
 
 //-------------------------------------------------------------------------
 int GMapDialog::waypointIndex(QStandardItem *it)
 {
   for (int j=0; j<wptList.size(); j++){
-    if (it == wptList[j]) 
+    if (it == wptList[j])
       return j;
   }
   return -1;
@@ -274,7 +274,7 @@ int GMapDialog::waypointIndex(QStandardItem *it)
 int GMapDialog::trackIndex(QStandardItem *it)
 {
   for (int j=0; j<trkList.size(); j++){
-    if (it == trkList[j]) 
+    if (it == trkList[j])
       return j;
   }
   return -1;
@@ -284,14 +284,14 @@ int GMapDialog::trackIndex(QStandardItem *it)
 int GMapDialog::routeIndex(QStandardItem *it)
 {
   for (int j=0; j<rteList.size(); j++){
-    if (it == rteList[j]) 
+    if (it == rteList[j])
       return j;
   }
   return -1;
 }
 
 //-------------------------------------------------------------------------
-void GMapDialog::treeDoubleClicked(const QModelIndex &idx) 
+void GMapDialog::treeDoubleClicked(const QModelIndex &idx)
 {
   QStandardItem *it = model->itemFromIndex(idx);
   int i = waypointIndex(it);
@@ -321,7 +321,7 @@ void GMapDialog::treeDoubleClicked(const QModelIndex &idx)
 }
 
 //-------------------------------------------------------------------------
-void GMapDialog::waypointClickedX(int i) 
+void GMapDialog::waypointClickedX(int i)
 {
   if (i>=0 && i < wptList.size()) {
     QStandardItem *it = wptList[i];
@@ -331,7 +331,7 @@ void GMapDialog::waypointClickedX(int i)
   }
 }
 //-------------------------------------------------------------------------
-void GMapDialog::trackClickedX(int i) 
+void GMapDialog::trackClickedX(int i)
 {
   if (i>=0 && i <trkList.size()) {
     QStandardItem *it = trkList[i];
@@ -342,7 +342,7 @@ void GMapDialog::trackClickedX(int i)
 }
 
 //-------------------------------------------------------------------------
-void GMapDialog::routeClickedX(int i) 
+void GMapDialog::routeClickedX(int i)
 {
   if (i>=0 && i <rteList.size()) {
     QStandardItem *it = rteList[i];
@@ -358,16 +358,16 @@ void GMapDialog::selectionChangedX (const QItemSelection &sel,  const QItemSelec
   int k=0;
   foreach (QStandardItem*w, wptList) {
     QModelIndex idx = model->indexFromItem(w);
-    if (desel.contains(idx)) 
+    if (desel.contains(idx))
       mapWidget->setWaypointColorBlue(k);
-    if (sel.contains(idx)) 
+    if (sel.contains(idx))
       mapWidget->setWaypointColorRed(k);
     k++;
   }
 }
 
 //------------------------------------------------------------------------
-void GMapDialog::expandCollapseAll(const QList<QStandardItem *> &li, 
+void GMapDialog::expandCollapseAll(const QList<QStandardItem *> &li,
                                   QStandardItem *top, bool exp)
 {
   ui.treeView->setExpanded(model->indexFromItem(top), exp);
@@ -410,7 +410,7 @@ void GMapDialog::collapseAllRoutes()
 }
 
 //------------------------------------------------------------------------
-void GMapDialog::checkUncheckAll(const QList<QStandardItem *> &li, 
+void GMapDialog::checkUncheckAll(const QList<QStandardItem *> &li,
                                   QStandardItem *top, bool ck)
 {
   top->setCheckState(ck ? Qt::Checked: Qt::Unchecked);
@@ -421,7 +421,7 @@ void GMapDialog::checkUncheckAll(const QList<QStandardItem *> &li,
 //------------------------------------------------------------------------
 void GMapDialog::showAllWaypoints()
 {
-  foreach (GpxWaypoint wpt, gpx.getWaypoints()) 
+  foreach (GpxWaypoint wpt, gpx.getWaypoints())
     wpt.setVisible(true);
   checkUncheckAll(wptList, wptItem, true);
   mapWidget->showWaypoints(gpx.getWaypoints());
@@ -429,7 +429,7 @@ void GMapDialog::showAllWaypoints()
 //------------------------------------------------------------------------
 void GMapDialog::showAllTracks()
 {
-  foreach (GpxTrack trk, gpx.getTracks()) 
+  foreach (GpxTrack trk, gpx.getTracks())
     trk.setVisible(true);
   checkUncheckAll(trkList, trkItem, true);
   mapWidget->showTracks(gpx.getTracks());
@@ -438,7 +438,7 @@ void GMapDialog::showAllTracks()
 //------------------------------------------------------------------------
 void GMapDialog::showAllRoutes()
 {
-  foreach (GpxRoute rte, gpx.getRoutes()) 
+  foreach (GpxRoute rte, gpx.getRoutes())
     rte.setVisible(true);
   checkUncheckAll(rteList, rteItem, true);
   mapWidget->showRoutes(gpx.getRoutes());
@@ -447,7 +447,7 @@ void GMapDialog::showAllRoutes()
 //------------------------------------------------------------------------
 void GMapDialog::hideAllWaypoints()
 {
-  foreach (GpxWaypoint wpt, gpx.getWaypoints()) 
+  foreach (GpxWaypoint wpt, gpx.getWaypoints())
     wpt.setVisible(false);
   checkUncheckAll(wptList, wptItem, false);
   mapWidget->showWaypoints(gpx.getWaypoints());
@@ -455,7 +455,7 @@ void GMapDialog::hideAllWaypoints()
 //------------------------------------------------------------------------
 void GMapDialog::hideAllTracks()
 {
-  foreach (GpxTrack trk, gpx.getTracks()) 
+  foreach (GpxTrack trk, gpx.getTracks())
     trk.setVisible(false);
   checkUncheckAll(trkList, trkItem, false);
   mapWidget->showTracks(gpx.getTracks());
@@ -464,7 +464,7 @@ void GMapDialog::hideAllTracks()
 //------------------------------------------------------------------------
 void GMapDialog::hideAllRoutes()
 {
-  foreach (GpxRoute rte, gpx.getRoutes()) 
+  foreach (GpxRoute rte, gpx.getRoutes())
     rte.setVisible(false);
   checkUncheckAll(rteList, rteItem, false);
   mapWidget->showRoutes(gpx.getRoutes());
@@ -508,7 +508,7 @@ void GMapDialog::showOnlyThisRoute()
 }
 
 //------------------------------------------------------------------------
-void GMapDialog::showContextMenu(const QPoint &pt) 
+void GMapDialog::showContextMenu(const QPoint &pt)
 {
   QModelIndex idx = ui.treeView->indexAt(pt);
   QStandardItem *it = model->itemFromIndex(idx);
@@ -558,4 +558,3 @@ void GMapDialog::showContextMenu(const QPoint &pt)
   else {
   }
 }
-
index d95fcb450e3c44b2735698538596abcc33368d73..86e6da4c4cc0a802e72c55cb0ddbd6d4f58b9223 100755 (executable)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: gpx.cpp,v 1.1 2009-07-05 21:14:56 robertl Exp $
+// $Id: gpx.cpp,v 1.2 2009-08-28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -29,7 +29,7 @@
 #include "gpx.h"
 
 
-static QDateTime decodeDateTime(const QString s) 
+static QDateTime decodeDateTime(const QString s)
 {
   QDateTime utc = QDateTime::fromString(s, "yyyy-MM-dd'T'HH:mm:ss'Z'");
   return utc;
@@ -45,10 +45,10 @@ static bool trackIsEmpty(const GpxTrack &trk){
   return count <=2 ;
 }
 
-class GpxHandler: public QXmlDefaultHandler 
+class GpxHandler: public QXmlDefaultHandler
 {
-public: 
-  GpxHandler(): QXmlDefaultHandler() 
+public:
+  GpxHandler(): QXmlDefaultHandler()
 
   {
     state = e_noop;
@@ -122,12 +122,12 @@ public:
     }
 
 
-    else if (state == e_wpt || 
+    else if (state == e_wpt ||
             state == e_trkpt || state == e_trkseg || state == e_trk ||
             state == e_rte || state == e_rtept) {
     }
     else {
-      //fprintf(stderr, "localName:  %s     name:  %s\n", 
+      //fprintf(stderr, "localName:  %s     name:  %s\n",
       //localName.toStdString().c_str(), qName.toStdString().c_str());
     }
     return true;
@@ -175,7 +175,7 @@ public:
 
     else if (localName == "trk") {
       state = stateStack.takeLast();
-      if (!trackIsEmpty(currentTrk)) 
+      if (!trackIsEmpty(currentTrk))
        trkList << currentTrk;
     }
 
@@ -206,7 +206,7 @@ public:
     }
 
     else {
-      //fprintf(stderr, "end ---- localName:  %s     name:  %s\n\n", 
+      //fprintf(stderr, "end ---- localName:  %s     name:  %s\n\n",
       //localName.toStdString().c_str(), qName.toStdString().c_str());
     }
     return true;
@@ -225,7 +225,7 @@ public:
 bool Gpx::read(const QString & fileName)
 {
   QFile file(fileName);
-  if (!file.open(QIODevice::ReadOnly)) 
+  if (!file.open(QIODevice::ReadOnly))
     return false;
 
   QXmlInputSource xmlIn(&file);
@@ -240,8 +240,6 @@ bool Gpx::read(const QString & fileName)
     routes = gpxHandler.rteList;
     return true;
   }
-  else 
+  else
     return false;
 }
-
-
index e68a0e6048eed08b07a66aa2c674b4ad69e9298f..ca079a099da8b110e6a42f013e68ed187de02261 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: help.cpp,v 1.3 2009-07-27 04:04:42 robertl Exp $
+// $Id: help.cpp,v 1.4 2009-08-28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -28,7 +28,7 @@
 //------------------------------------------------------------------------
 void ShowHelp(const char *name)
 {
-  QUrl urlname("file://" + QApplication::applicationDirPath() + 
+  QUrl urlname("file://" + QApplication::applicationDirPath() +
                 "/help/" + name);
   // FIXME(robertl): This shoud probably parent from QApplication::mainWidget();
   QWebView *view = new QWebView();
@@ -36,4 +36,3 @@ void ShowHelp(const char *name)
   view->load(urlname);
   view->show();
 }
-
index 04083b598439863dbf1a1ae94e5fc3bbabaefb89..11e506cb2b2417e151a9175b8b0a00f97e2b4f80 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: latlng.cpp,v 1.1 2009-07-05 21:14:56 robertl Exp $
+// $Id: latlng.cpp,v 1.2 2009-08-28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -43,7 +43,7 @@ static const double EARTH_RADIUS_IN_METERS = 6372797.560856;
   *
   * @sa http://en.wikipedia.org/wiki/Law_of_haversines
   */
-static double ArcInRadians(const LatLng& from, const LatLng& to) 
+static double ArcInRadians(const LatLng& from, const LatLng& to)
 {
   double latitudeArc  = (from.lat() - to.lat()) * DEG_TO_RAD;
   double longitudeArc = (from.lng() - to.lng()) * DEG_TO_RAD;
index ac6920e676f2e9e9ecef939759a5abd4202b1492..dece2f8874ed89b287644a1c0a10eb2d631aa898 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: main.cpp,v 1.3 2009-07-23 03:22:24 robertl Exp $
+// $Id: main.cpp,v 1.4 2009-08-28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -63,7 +63,7 @@ int main(int argc, char**argv)
   installTranslation(app, "qt_");
   installTranslation(app, "gpsbabelfe_");
   installTranslation(app, "gpsbabel_");
-  
+
   QCoreApplication::setOrganizationName("GPSBabel");
   QCoreApplication::setOrganizationDomain("gpsbabel.org");
   QCoreApplication::setApplicationName("GPSBabelFE");
@@ -72,4 +72,3 @@ int main(int argc, char**argv)
   mainWindow.show();
   app->exec();
 }
-
index 595f65ae63af2ccb1cb582c35a067d170b395f7b..dff258178904ed32670b5005c790a1c75b15cb72 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: mainwindow.cpp,v 1.4 2009-08-06 03:19:10 robertl Exp $
+// $Id: mainwindow.cpp,v 1.5 2009-08-28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -103,7 +103,7 @@ static QStringList getCharSets()
 }
 
 //------------------------------------------------------------------------
-static QString MakeOptions(const QList<FormatOption>& options) 
+static QString MakeOptions(const QList<FormatOption>& options)
 {
   QString str;
   for (int i=0; i<options.size(); i++) {
@@ -119,11 +119,11 @@ static QString MakeOptions(const QList<FormatOption>& options)
 }
 
 //------------------------------------------------------------------------
-static QString MakeOptionsNoLeadingComma(const QList<FormatOption>& options) 
+static QString MakeOptionsNoLeadingComma(const QList<FormatOption>& options)
 {
   QString str = MakeOptions(options);
   return (str.length()) ? str.mid(1) : str;
-    
+
 }
 //------------------------------------------------------------------------
 MainWindow::MainWindow(QWidget* parent): QMainWindow(parent)
@@ -181,7 +181,7 @@ MainWindow::MainWindow(QWidget* parent): QMainWindow(parent)
   lights[1] = QPixmap::fromImage(QImage(":images/01.png").scaledToHeight(20, Qt::SmoothTransformation));
   lights[2] = QPixmap::fromImage(QImage(":images/10.png").scaledToHeight(20, Qt::SmoothTransformation));
   lights[3] = QPixmap::fromImage(QImage(":images/11.png").scaledToHeight(20, Qt::SmoothTransformation));
-  
+
   ui.outputWindow->setReadOnly(true);
 
 
@@ -254,7 +254,7 @@ void MainWindow::inputFileOptBtnClicked()
 }
 
 //------------------------------------------------------------------------
-void MainWindow::inputDeviceOptBtnClicked() 
+void MainWindow::inputDeviceOptBtnClicked()
 {
   fmtChgInterlock = true;
   QString fmt = bd.inputDeviceFormat;
@@ -285,7 +285,7 @@ void MainWindow:: outputFileOptBtnClicked()
       ui.outputFormatCombo->addItem(formatList[k].getDescription(), QVariant(k));
     }
     setComboToFormat(ui.outputFormatCombo, fmt, true);
-  } 
+  }
   else {
     ui.outputStackedWidget->setCurrentWidget(ui.outputFilePage);
     ui.outputFilePage->setEnabled(false);
@@ -363,17 +363,17 @@ void MainWindow::browseInputFile()
   if (!finfo.isDir() && (!filterForFormatIncludes(idx, finfo.suffix()))) {
     startFile = finfo.dir().absolutePath();
   }
-  QStringList userList = 
+
+  QStringList userList =
     QFileDialog::getOpenFileNames(0, tr("Select one or more input files"),
-                                 startFile, 
+                                 startFile,
                                  filterForFormat(idx));
   if (userList.size()) {
     bd.inputBrowse = userList[0];
     bd.inputFileNames = userList;
     QString str;
     for (int i=0; i<bd.inputFileNames.size(); i++) {
-      if (i != 0) 
+      if (i != 0)
        str += ", ";
       str += "\"" + bd.inputFileNames[i] + "\"";
     }
@@ -390,10 +390,10 @@ void MainWindow::browseOutputFile()
   if (!finfo.isDir() && (!filterForFormatIncludes(idx, finfo.suffix()))) {
     startFile = finfo.dir().absolutePath();
   }
+
   QString str =
     QFileDialog::getSaveFileName(0, tr("Output File Name"),
-                                startFile, 
+                                startFile,
                                 filterForFormat(idx));
   if (str.length() != 0) {
     bd.outputBrowse = str;
@@ -407,7 +407,7 @@ QList<int> MainWindow::inputFileFormatIndices()
 {
   QList<int>indices;
   for (int i=0; i<formatList.size(); i++) {
-    if (formatList[i].isReadSomething() && formatList[i].isFileFormat()) 
+    if (formatList[i].isReadSomething() && formatList[i].isFileFormat())
       indices<<i;
   }
   return indices;
@@ -418,7 +418,7 @@ QList<int> MainWindow::inputDeviceFormatIndices()
 {
   QList<int>indices;
   for (int i=0; i<formatList.size(); i++) {
-    if (formatList[i].isReadSomething() && formatList[i].isDeviceFormat()) 
+    if (formatList[i].isReadSomething() && formatList[i].isDeviceFormat())
       indices<<i;
   }
   return indices;
@@ -429,7 +429,7 @@ QList<int> MainWindow::outputFileFormatIndices()
 {
   QList<int>indices;
   for (int i=0; i<formatList.size(); i++) {
-    if (formatList[i].isWriteSomething() && formatList[i].isFileFormat()) 
+    if (formatList[i].isWriteSomething() && formatList[i].isFileFormat())
       indices<<i;
   }
   return indices;
@@ -440,7 +440,7 @@ QList<int> MainWindow::outputDeviceFormatIndices()
 {
   QList<int>indices;
   for (int i=0; i<formatList.size(); i++) {
-    if (formatList[i].isWriteSomething() && formatList[i].isDeviceFormat()) 
+    if (formatList[i].isWriteSomething() && formatList[i].isDeviceFormat())
       indices<<i;
   }
   return indices;
@@ -450,7 +450,7 @@ QList<int> MainWindow::outputDeviceFormatIndices()
 void MainWindow::loadFormats()
 {
   if (!FormatLoad().getFormats(formatList)) {
-    QMessageBox::information(0, QString(appName), 
+    QMessageBox::information(0, QString(appName),
                             tr("Error reading format configuration.  "
                                "Check that the backend program \"gpsbabel\" is properly installed "
                                "and is in the current PATH\n\n"
@@ -461,7 +461,7 @@ void MainWindow::loadFormats()
       inputDeviceFormatIndices().size() == 0 ||
       outputFileFormatIndices().size() == 0 ||
       outputDeviceFormatIndices().size() == 0) {
-    QMessageBox::information(0, QString(appName), 
+    QMessageBox::information(0, QString(appName),
                             tr("Some file/device formats were not found during initialization.  "
                                "Check that the backend program \"gpsbabel\" is properly installed "
                                "and is in the current PATH\n\n"
@@ -476,11 +476,11 @@ static int iconIndex(bool a, bool b)
 }
 
 //------------------------------------------------------------------------
-void MainWindow::setIndicatorLights(QLabel *label, const QString type, int code) 
+void MainWindow::setIndicatorLights(QLabel *label, const QString type, int code)
 {
   label->setPixmap(lights[code]);
   QString s;
-  switch (code) 
+  switch (code)
     {
     default:
     case 0:
@@ -509,23 +509,23 @@ void MainWindow::crossCheckInOutFormats()
   }
   Format ifmt = formatList[currentComboFormatIndex(ui.inputFormatCombo)];
   Format ofmt = formatList[currentComboFormatIndex(ui.outputFormatCombo)];
-  
+
   ui.xlateWayPtsCk->setEnabled(ifmt.isReadWaypoints() && ofmt.isWriteWaypoints());
   ui.xlateTracksCk->setEnabled(ifmt.isReadTracks()    && ofmt.isWriteTracks());
   ui.xlateRoutesCk->setEnabled(ifmt.isReadRoutes()    && ofmt.isWriteRoutes());
-  
+
   setIndicatorLights(ui.wayPtLabel, tr("waypoints"), iconIndex(ifmt.isReadWaypoints(), ofmt.isWriteWaypoints()));
   setIndicatorLights(ui.trackLabel, tr("tracks"), iconIndex(ifmt.isReadTracks(), ofmt.isWriteTracks()));
   setIndicatorLights(ui.routeLabel, tr("routes"), iconIndex(ifmt.isReadRoutes(), ofmt.isWriteRoutes()));
 }
 
 //------------------------------------------------------------------------
-void MainWindow::displayOptionsText(QLineEdit *le, QComboBox *combo, bool isInput) 
+void MainWindow::displayOptionsText(QLineEdit *le, QComboBox *combo, bool isInput)
 {
   int fidx = combo->itemData(combo->currentIndex()).toInt();
   if (isInput)
     le->setText(MakeOptionsNoLeadingComma(formatList[fidx].getInputOptions()));
-  else 
+  else
     le->setText(MakeOptionsNoLeadingComma(formatList[fidx].getOutputOptions()));
 
 }
@@ -552,7 +552,7 @@ void MainWindow::setComboToFormat(QComboBox *comboBox, const QString &name, bool
 }
 
 //------------------------------------------------------------------------
-void MainWindow::inputFormatChanged(int comboIdx) 
+void MainWindow::inputFormatChanged(int comboIdx)
 {
   if (fmtChgInterlock)
     return;
@@ -568,7 +568,7 @@ void MainWindow::inputFormatChanged(int comboIdx)
 }
 
 //------------------------------------------------------------------------
-void MainWindow::outputFormatChanged(int comboIdx) 
+void MainWindow::outputFormatChanged(int comboIdx)
 {
   if (fmtChgInterlock)
     return;
@@ -585,10 +585,10 @@ void MainWindow::outputFormatChanged(int comboIdx)
 }
 
 //------------------------------------------------------------------------
-void MainWindow::inputOptionButtonClicked() 
+void MainWindow::inputOptionButtonClicked()
 {
   int fidx = currentComboFormatIndex(ui.inputFormatCombo);
-  OptionsDlg optionDlg(0, 
+  OptionsDlg optionDlg(0,
                       formatList[fidx].getName(),
                       formatList[fidx].getInputOptionsRef());
   optionDlg.setWindowTitle(QString(appName) + " - " + tr("Options for %1").arg(formatList[fidx].getName()));
@@ -597,7 +597,7 @@ void MainWindow::inputOptionButtonClicked()
 }
 
 //------------------------------------------------------------------------
-void MainWindow::outputOptionButtonClicked() 
+void MainWindow::outputOptionButtonClicked()
 {
   int fidx = currentComboFormatIndex(ui.outputFormatCombo);
   OptionsDlg optionDlg(0, formatList[fidx].getName(), formatList[fidx].getOutputOptionsRef());
@@ -616,7 +616,7 @@ bool MainWindow::isOkToGo()
     QMessageBox::information(0, QString(appName), tr("No valid waypoints/routes/tracks translation specified"));
     return false;
   }
-  
+
   if ((bd.inputType == BabelData::fileType) &&
       (bd.inputFileNames.size() == 0)) {
     QMessageBox::information(0, QString(appName), tr("No input file specified"));
@@ -629,7 +629,7 @@ bool MainWindow::isOkToGo()
     QMessageBox::information(0, QString(appName), tr("No valid output specified"));
     return false;
   }
-  else if (bd.outputType == BabelData::fileType && 
+  else if (bd.outputType == BabelData::fileType &&
           bd.outputFileName.length() == 0) {
     QMessageBox::information(0, QString(appName), tr("No output file specified"));
     return false;
@@ -638,7 +638,7 @@ bool MainWindow::isOkToGo()
 }
 
 //------------------------------------------------------------------------
-bool MainWindow::runGpsbabel(const QStringList &args, QString &errorString, 
+bool MainWindow::runGpsbabel(const QStringList &args, QString &errorString,
                          QString &outputString)
 {
   QProcess *proc = new QProcess(0);
@@ -650,7 +650,7 @@ bool MainWindow::runGpsbabel(const QStringList &args, QString &errorString,
     errorString = QString(tr("Process \"%1\" did not start")).arg(name);
     return false;
   }
-  
+
   waitDlg->show();
   waitDlg->exec();
   int exitCode = -1;
@@ -660,7 +660,7 @@ bool MainWindow::runGpsbabel(const QStringList &args, QString &errorString,
     if (exitCode == 0)
       retStatus = true;
     else  {
-      errorString = 
+      errorString =
        QString(tr("Process exited unsucessfully with code %1"))
        .arg(exitCode);
       retStatus = false;
@@ -703,7 +703,7 @@ void MainWindow::setComboToCharSet(QComboBox *combo, const QString &cset)
   }
 }
 //------------------------------------------------------------------------
-void MainWindow::applyActionX() 
+void MainWindow::applyActionX()
 {
   getWidgetValues();
   if (!isOkToGo())
@@ -715,7 +715,7 @@ void MainWindow::applyActionX()
   if (bd.synthShortNames)    args << "-s";
 
   // Input char set if specified
-  if (bd.enableCharSetXform && bd.inputCharSet != QString()) 
+  if (bd.enableCharSetXform && bd.inputCharSet != QString())
     args << "-c" << bd.inputCharSet;
 
   if (bd.xlateWayPts)        args << "-w";
@@ -728,10 +728,10 @@ void MainWindow::applyActionX()
                                 bd.inputFileFormat : bd.inputDeviceFormat);
   args << "-i";
   args << (formatList[fidx].getName() + MakeOptions(formatList[fidx].getInputOptions()));
-  
+
   // Input file(s) or device
   if (bd.inputType == BabelData::fileType) {
-    for (int i=0; i<bd.inputFileNames.size(); i++) 
+    for (int i=0; i<bd.inputFileNames.size(); i++)
       args << "-f" << bd.inputFileNames[i];
   }
   else {
@@ -742,7 +742,7 @@ void MainWindow::applyActionX()
   args << filterData.getAllFilterStrings();
 
   // Output char set if specified
-  if (bd.enableCharSetXform && bd.outputCharSet != QString()) 
+  if (bd.enableCharSetXform && bd.outputCharSet != QString())
     args << "-c" << bd.outputCharSet;
 
   // Output type, with options
@@ -752,7 +752,7 @@ void MainWindow::applyActionX()
                                           bd.outputFileFormat : bd.outputDeviceFormat));
     args << "-o";
     args << (formatList[fidx].getName() + MakeOptions(formatList[fidx].getOutputOptions()));
-    
+
     // output file or device option
     if (outIsFile) {
       if (bd.outputFileName != "")
@@ -800,12 +800,12 @@ void MainWindow::applyActionX()
       this->show();
     }
   }
-  else 
+  else
     ui.outputWindow->appendPlainText(tr("Error running gpsbabel: %1\n").arg(errorString));
 }
 
 //------------------------------------------------------------------------
-void MainWindow::closeActionX() 
+void MainWindow::closeActionX()
 {
   QDateTime wt= upgrade->getUpgradeWarningTime();
   if (wt.isValid()) {
@@ -818,7 +818,7 @@ void MainWindow::closeActionX()
 }
 
 //------------------------------------------------------------------------
-void MainWindow::closeEvent(QCloseEvent*)  
+void MainWindow::closeEvent(QCloseEvent*)
 {
   closeActionX();
 }
@@ -840,7 +840,7 @@ void MainWindow::saveSettings()
 
   QSettings settings;
   bd.saveSettings(settings);
-  for (int i=0; i<formatList.size(); i++) 
+  for (int i=0; i<formatList.size(); i++)
     formatList[i].saveSettings(settings);
   for (int i=0; i<filterData.filters.size(); i++)
     filterData.filters[i]->saveSettings(settings);
@@ -851,7 +851,7 @@ void MainWindow::restoreSettings()
 {
   QSettings settings;
   bd.restoreSettings(settings);
-  for (int i=0; i<formatList.size(); i++) 
+  for (int i=0; i<formatList.size(); i++)
     formatList[i].restoreSettings(settings);
 
   for (int i=0; i<filterData.filters.size(); i++)
@@ -868,7 +868,7 @@ void MainWindow::resetFormatDefaults()
      tr("Are you sure you want to reset all format options to default values?"),
      QMessageBox::Yes | QMessageBox::No);
   if (ret == QMessageBox::Yes) {
-    for (int i=0; i<formatList.size(); i++) 
+    for (int i=0; i<formatList.size(); i++)
       formatList[i].setToDefault();
     displayOptionsText(ui.inputOptionsText,  ui.inputFormatCombo, true);
     displayOptionsText(ui.outputOptionsText,  ui.outputFormatCombo, false);
@@ -878,7 +878,7 @@ void MainWindow::resetFormatDefaults()
 //------------------------------------------------------------------------
 void MainWindow::moreOptionButtonClicked()
 {
-  AdvDlg advDlg(0, bd.synthShortNames, 
+  AdvDlg advDlg(0, bd.synthShortNames,
                bd.forceGPSTypes, bd.enableCharSetXform, bd.previewGmap, bd.debugLevel);
   connect(advDlg.formatButton(), SIGNAL(clicked()),
          this, SLOT(resetFormatDefaults()));
@@ -912,7 +912,7 @@ void MainWindow::updateFilterStatus()
 {
   bool filterActive = filterData.getAllFilterStrings().size();
   ui.filterStatus->setEnabled(filterActive);
-  if (filterActive) 
+  if (filterActive)
     ui.filterStatus->setToolTip(tr("One or more data filters are active"));
   else {
     ui.filterStatus->setToolTip(tr("No data filters are active"));
@@ -1007,5 +1007,3 @@ void MainWindow::getWidgetValues()
   bd.xlateTracks = ui.xlateTracksCk->isChecked();
   bd.xlateRoutes = ui.xlateRoutesCk->isChecked();
 }
-
-
index 0ff1ec19290a0a58328270fa9e2ac1c7c8044fc2..8c40fe68c3ac7988490efaf6357bfb136ebd2589 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: mainwindow.h,v 1.3 2009-08-06 03:19:10 robertl Exp $
+// $Id: mainwindow.h,v 1.4 2009-08-28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -31,7 +31,7 @@
 class MainWindow: public QMainWindow {
   Q_OBJECT
 
-  
+
   public:
   MainWindow(QWidget* parent);
   ~MainWindow();
index 268889f855934d74995720921edf4adab6362161..21e4c23ade8c73e8f1182a39380c9202500dba98 100755 (executable)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: map.cpp,v 1.1 2009-07-05 21:14:56 robertl Exp $
+// $Id: map.cpp,v 1.2 2009-08-28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -45,12 +45,12 @@ static QString stripDoubleQuotes(const QString s) {
 }
 
 //------------------------------------------------------------------------
-Map::Map(QWidget *parent, 
+Map::Map(QWidget *parent,
         const Gpx  &gpx, QPlainTextEdit *te):
-    QWebView(parent), 
+    QWebView(parent),
     gpx(gpx),
     mapPresent(false),
-    busyCursor(false), 
+    busyCursor(false),
     te(te)
 {
   busyCursor = true;
@@ -59,7 +59,7 @@ Map::Map(QWidget *parent,
   manager = new QNetworkAccessManager(this);
   connect(this,SIGNAL(loadFinished(bool)),
          this,SLOT(loadFinishedX(bool)));
-  this->logTimeX("Start map constuctor"); 
+  this->logTimeX("Start map constuctor");
   QString baseFile =  QApplication::applicationDirPath() + "/gmapbase.html";
   if (!QFile(baseFile).exists()) {
     QMessageBox::critical(0, appName,
@@ -80,8 +80,8 @@ Map::~Map()
 //------------------------------------------------------------------------
 void Map::loadFinishedX(bool f)
 {
-  this->logTimeX("Done initial page load"); 
-  if (!f) 
+  this->logTimeX("Done initial page load");
+  if (!f)
     QMessageBox::critical(0, appName,
                          tr("Failed to load Google maps base page"));
   else {
@@ -132,7 +132,7 @@ void Map::showGpxData()
   // It is appreciably faster to do the encoding on the C++ side.
   int numLevels = 18;
   double zoomFactor = 2;
-  PolylineEncoder encoder(numLevels, zoomFactor, 0.00001); 
+  PolylineEncoder encoder(numLevels, zoomFactor, 0.00001);
 
 
   this->logTimeX("Start defining JS string");
@@ -158,11 +158,11 @@ void Map::showGpxData()
     ;
 
   mapPresent = true;
-  
+
   // Waypoints.
   int num=0;
   foreach (const  GpxWaypoint &pt, gpx.getWaypoints() ) {
-    scriptStr 
+    scriptStr
       << QString("waypts[%1] = new GMarker(new GLatLng(%2), "
                 "{title:\"%3\",icon:blueIcon});")
       .arg(num)
@@ -193,7 +193,7 @@ void Map::showGpxData()
     string encPts, encLevels;
     encoder.dpEncode(encPts, encLevels, epts);
 
-    scriptStr 
+    scriptStr
       << QString("var startPt = new GLatLng(%1);").arg(fmtLatLng(epts[0]))
       << QString("var endPt = new GLatLng(%1);").arg(fmtLatLng(epts[epts.size()-1]))
       << QString("var idx = %1;").arg(num)
@@ -210,7 +210,7 @@ void Map::showGpxData()
 
   scriptStr
     << "for( var i=0; i<trks.length; ++i ) {"
-    << "   var trkbound = trks[i].getBounds();" 
+    << "   var trkbound = trks[i].getBounds();"
     << "   bounds.extend(trkbound.getSouthWest());"
     << "   bounds.extend(trkbound.getNorthEast());"
     << "}"
@@ -226,7 +226,7 @@ void Map::showGpxData()
     }
     string encPts, encLevels;
     encoder.dpEncode(encPts, encLevels, epts);
-    scriptStr 
+    scriptStr
       << QString("var startPt = new GLatLng(%1);").arg(fmtLatLng(epts[0]))
       << QString("var endPt = new GLatLng(%1);").arg(fmtLatLng(epts[epts.size()-1]))
       << QString("var idx = %1;").arg(num)
@@ -242,7 +242,7 @@ void Map::showGpxData()
 
   scriptStr
     << "for( var i=0; i<rtes.length; ++i ) {"
-    << "   var rtebound = rtes[i].getBounds();" 
+    << "   var rtebound = rtes[i].getBounds();"
     << "   bounds.extend(rtebound.getSouthWest());"
     << "   bounds.extend(rtebound.getNorthEast());"
     << "}"
@@ -253,7 +253,7 @@ void Map::showGpxData()
     << "map.setCenter(bounds.getCenter(), map.getBoundsZoomLevel(bounds));"
     << "mclicker.logTime(\"done setCenter\");"
     ;
-  
+
   this->logTimeX("Done defining JS string");
   evaluateJS(scriptStr);
   this->logTimeX("Done JS evaluation");
@@ -261,11 +261,11 @@ void Map::showGpxData()
 
 //------------------------------------------------------------------------
 void Map::markerClicked(int t, int i){
-  if (t == 0) 
+  if (t == 0)
     emit waypointClicked(i);
-  else if (t == 1) 
+  else if (t == 1)
     emit trackClicked(i);
-  else if (t == 2) 
+  else if (t == 2)
     emit routeClicked(i);
 
 }
@@ -359,7 +359,7 @@ void Map::setTrackVisibility(int i, bool show)
 {
   QString x = show?"show": "hide";
   QStringList scriptStr;
-  scriptStr 
+  scriptStr
     << QString("trks[%1].%2();").arg(i).arg(x)
     ;
   evaluateJS(scriptStr);
@@ -370,7 +370,7 @@ void Map::setRouteVisibility(int i, bool show)
 {
   QString x = show?"show": "hide";
   QStringList scriptStr;
-  scriptStr 
+  scriptStr
     << QString("rtes[%1].%2();").arg(i).arg(x)
     ;
   evaluateJS(scriptStr);
@@ -386,7 +386,7 @@ void Map::panTo(const LatLng &loc)
 void Map::resizeEvent ( QResizeEvent * ev)
 {
   QWebView::resizeEvent(ev);
-  if (mapPresent) 
+  if (mapPresent)
     evaluateJS(QString("map.checkResize();"));
 }
 
@@ -427,7 +427,7 @@ void Map::frameRoute(int i)
 
 
 //------------------------------------------------------------------------
-void Map::evaluateJS(const QString &s, bool upd) 
+void Map::evaluateJS(const QString &s, bool upd)
 {
   this->page()->mainFrame()->evaluateJavaScript(s);
   if (upd) {
@@ -436,7 +436,7 @@ void Map::evaluateJS(const QString &s, bool upd)
 }
 
 //------------------------------------------------------------------------
-void Map::evaluateJS(const QStringList &s, bool upd) 
+void Map::evaluateJS(const QStringList &s, bool upd)
 {
   evaluateJS(s.join("\n"), upd);
 }
index 22ba3e4f1c30bc28a920ba260f70c349c0f01381..8ca9bb5819f222f491e8ab279a2ddc7c33f7a64a 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: optionsdlg.cpp,v 1.1 2009-07-05 21:14:56 robertl Exp $
+// $Id: optionsdlg.cpp,v 1.2 2009-08-28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -42,19 +42,19 @@ static void SetSizeStuff(QWidget *w)
 }
 
 //------------------------------------------------------------------------
-FileDlgManager::FileDlgManager(QObject*parent, 
+FileDlgManager::FileDlgManager(QObject*parent,
                               QLineEdit *le,
                               QToolButton *tb, bool isInFile):
   QObject(parent), le(le), tb(tb), isInFile(isInFile)
 {
   connect(tb, SIGNAL(clicked()), this, SLOT(buttonClicked()));
 }
-  
+
 //------------------------------------------------------------------------
 QVariant getOptionValue(QList<FormatOption> opts, int k) {
-  if (opts[k].getValue().toString() != "") 
+  if (opts[k].getValue().toString() != "")
     return opts[k].getValue();
-  else 
+  else
     return opts[k].getDefaultValue();
 }
 
@@ -68,12 +68,12 @@ void FileDlgManager::buttonClicked()
   QString str;
   if (isInFile) {
     str = QFileDialog::getOpenFileName(0, tr("Select input file"),
-                                      le->text(), 
+                                      le->text(),
                                       "All Files (*.*)");
   }
   else {
     str = QFileDialog::getSaveFileName(0, tr("Select output file"),
-                                      le->text(), 
+                                      le->text(),
                                       "All Files (*.*)");
   }
   if (str != "")
@@ -98,11 +98,11 @@ OptionsDlg::OptionsDlg(QWidget*parent,  const QString &fmtName, QList<FormatOpti
 
     QSpacerItem *horizontalSpacer = new QSpacerItem(0, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
     horizontalLayout->addItem(horizontalSpacer);
-    
+
     QWidget *w = 0;
-    switch (options[k].getType()) 
+    switch (options[k].getType())
       {
-      case FormatOption::OPTstring: 
+      case FormatOption::OPTstring:
        {
          QLineEdit *lineEdit = new QLineEdit(this);
          SetSizeStuff(lineEdit);
@@ -112,8 +112,8 @@ OptionsDlg::OptionsDlg(QWidget*parent,  const QString &fmtName, QList<FormatOpti
        }
        break;
 
-      case FormatOption::OPTinFile: 
-      case FormatOption::OPToutFile: 
+      case FormatOption::OPTinFile:
+      case FormatOption::OPToutFile:
        {
          bool inFile = options[k].getType() == FormatOption::OPTinFile;
          QLineEdit *lineEdit = new QLineEdit(this);
@@ -128,7 +128,7 @@ OptionsDlg::OptionsDlg(QWidget*parent,  const QString &fmtName, QList<FormatOpti
        }
        break;
 
-      case FormatOption::OPTbool: 
+      case FormatOption::OPTbool:
        w = 0;
        break;
 
@@ -174,7 +174,7 @@ OptionsDlg::OptionsDlg(QWidget*parent,  const QString &fmtName, QList<FormatOpti
       }
     checkBoxes.push_back(checkBox);
     fields.push_back(w);
-    
+
     verticalLayout->addLayout(horizontalLayout);
   }
   QPushButton *helpButton = new QPushButton(this);
@@ -218,7 +218,7 @@ void OptionsDlg::acceptClicked()
        value = qMax(qMin(value, options[k].getMaxValue().toDouble()),options[k].getMinValue().toDouble());
        options[k].setValue(QVariant(value));
       }
-      else 
+      else
        options[k].setValue(static_cast<QLineEdit*>(fields[k])->text());
     }
   }
index d45cee494ff991d5388d310cb54f2abff5107be0..09669a9426035d6e197505c1a3a100bc0979683a 100644 (file)
@@ -1,5 +1,5 @@
 // -*- c++ -*-
-// $Id: processwait.cpp,v 1.2 2009-07-20 02:30:02 robertl Exp $
+// $Id: processwait.cpp,v 1.3 2009-08-28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
 
 //------------------------------------------------------------------------
 
-QString ProcessWaitDialog::processErrorString( QProcess::ProcessError err) 
+QString ProcessWaitDialog::processErrorString( QProcess::ProcessError err)
 {
   switch (err)
     {
-    case QProcess::FailedToStart: 
-      return QString(tr("Process failed to start")); 
+    case QProcess::FailedToStart:
+      return QString(tr("Process failed to start"));
       break;
-    case QProcess::Crashed: 
+    case QProcess::Crashed:
       return QString(tr("Process crashed"));
       break;
     case QProcess::Timedout:
       return QString(tr("Process timedout"));
       break;
     case QProcess::WriteError:
-      return QString(tr("Error while trying to write to process")); 
+      return QString(tr("Error while trying to write to process"));
       break;
     case QProcess::ReadError:
       return QString(tr("Error while trying to read from process"));
       break;
     case QProcess::UnknownError:
     default:
-      return QString(tr("Unknown process error")); 
+      return QString(tr("Unknown process error"));
     }
   return QString("");
 }
@@ -67,23 +67,23 @@ ProcessWaitDialog::ProcessWaitDialog(QWidget *parent, QProcess *process):
   this->resize(400, 220);
   this->setWindowTitle(QString(appName) + tr(" ... Process GPSBabel"));
   QVBoxLayout *layout = new QVBoxLayout(this);
-  
+
   textEdit = new QPlainTextEdit(this);
   textEdit->setReadOnly(true);
   layout->addWidget(textEdit);
-  
+
   progressBar = new QProgressBar(this);
   progressBar->setTextVisible(false);
   layout->addWidget(progressBar);
-  
+
   buttonBox = new QDialogButtonBox(this);
   buttonBox->setOrientation(Qt::Horizontal);
   buttonBox->setStandardButtons(QDialogButtonBox::Abort);
   QPushButton* btn = buttonBox->button(QDialogButtonBox::Abort);
   btn->setText(tr("Stop Process"));
   layout->addWidget(buttonBox);
-  
-  connect(process, SIGNAL(error(QProcess::ProcessError)), 
+
+  connect(process, SIGNAL(error(QProcess::ProcessError)),
          this,    SLOT  (errorX(QProcess::ProcessError)));
   connect(process, SIGNAL(finished(int, QProcess::ExitStatus)),
          this,    SLOT  (finishedX(int, QProcess::ExitStatus)));
@@ -98,9 +98,9 @@ ProcessWaitDialog::ProcessWaitDialog(QWidget *parent, QProcess *process):
   bufferedOut = "";
 
   //
-  for (int i=0; i<=100; i+=2) 
+  for (int i=0; i<=100; i+=2)
     progressVals.push_back(i);
-  for (int i=98; i>0; i-=2) 
+  for (int i=98; i>0; i-=2)
     progressVals.push_back(i);
   progressIndex = progressVals.size()/2;
 
@@ -119,30 +119,30 @@ ProcessWaitDialog::~ProcessWaitDialog()
 {
 };
 //------------------------------------------------------------------------
-bool ProcessWaitDialog::getExitedNormally() 
+bool ProcessWaitDialog::getExitedNormally()
 {
   return (errorString.length() == 0);
 };
 
 //------------------------------------------------------------------------
-QString ProcessWaitDialog::getErrorString() 
+QString ProcessWaitDialog::getErrorString()
 {
   return errorString;
 };
 
 //------------------------------------------------------------------------
-int ProcessWaitDialog::getExitCode() 
+int ProcessWaitDialog::getExitCode()
 {
   return ecode;
 };
 
 //------------------------------------------------------------------------
-void ProcessWaitDialog::stopClickedX() 
+void ProcessWaitDialog::stopClickedX()
 {
   process->terminate();
 };
 //------------------------------------------------------------------------
-void ProcessWaitDialog::timeoutX() 
+void ProcessWaitDialog::timeoutX()
 {
   progressIndex++;
   int idx = progressIndex % progressVals.size();
@@ -166,7 +166,7 @@ void ProcessWaitDialog::errorX(QProcess::ProcessError err)
 };
 
 //------------------------------------------------------------------------
-void ProcessWaitDialog::finishedX(int exitCode, QProcess::ExitStatus es) 
+void ProcessWaitDialog::finishedX(int exitCode, QProcess::ExitStatus es)
 {
   ecode = exitCode;
   if (es == QProcess::CrashExit)
@@ -180,7 +180,7 @@ void ProcessWaitDialog::finishedX(int exitCode, QProcess::ExitStatus es)
 // appendPlainText automatically puts in a new line with every call.  That's
 // why you have to buffer it, and only append when we get a real newline.
 //
-void ProcessWaitDialog::appendToText(const char *ptr) 
+void ProcessWaitDialog::appendToText(const char *ptr)
 {
   outputString += QString(ptr);
   for (const char *cptr = ptr; *cptr; cptr++) {
@@ -197,7 +197,7 @@ void ProcessWaitDialog::appendToText(const char *ptr)
 
 
 //------------------------------------------------------------------------
-void ProcessWaitDialog::readyReadStandardErrorX() 
+void ProcessWaitDialog::readyReadStandardErrorX()
 {
   QByteArray d = process->readAllStandardError();
   appendToText(d.data());
index d20bd3d2558187adaddc521b198481f0b6145f59..9c83bea27dd63708d7dc042325f6a3f57d63e0af 100644 (file)
@@ -81,7 +81,7 @@ static void CloseSerialPort(int fileDescriptor);
 // releasing the iterator when iteration is complete.
 static kern_return_t FindModems(io_iterator_t *matchingServices)
 {
-    kern_return_t                      kernResult; 
+    kern_return_t                      kernResult;
     CFMutableDictionaryRef     classesToMatch;
 
 /*! @function IOServiceMatching
@@ -105,7 +105,7 @@ static kern_return_t FindModems(io_iterator_t *matchingServices)
                undefined. If the dictionary is a fixed-capacity dictionary and
                it is full before this operation, and the key does not exist in
                the dictionary, the behavior is undefined.
-       @param key The key of the value to set into the dictionary. If a key 
+       @param key The key of the value to set into the dictionary. If a key
                which matches this key is already present in the dictionary, only
                the value is changed ("add if absent, replace if present"). If
                no key matches the given key, the key-value pair is added to the
@@ -122,18 +122,18 @@ static kern_return_t FindModems(io_iterator_t *matchingServices)
 //        CFDictionarySetValue(classesToMatch,
 //                             CFSTR(kIOSerialBSDTypeKey),
 //                             CFSTR(kIOSerialBSDModemType));
-        
+
                // Each serial device object has a property with key
         // kIOSerialBSDTypeKey and a value that is one of kIOSerialBSDAllTypes,
         // kIOSerialBSDModemType, or kIOSerialBSDRS232Type. You can experiment with the
         // matching by changing the last parameter in the above call to CFDictionarySetValue.
-        
+
         // As shipped, this sample is only interested in modems,
-        // so add this property to the CFDictionary we're matching on. 
+        // so add this property to the CFDictionary we're matching on.
         // This will find devices that advertise themselves as modems,
         // such as built-in and USB modems. However, this match won't find serial modems.
     }
-    
+
     /*! @function IOServiceGetMatchingServices
         @abstract Look up registered IOService objects that match a matching dictionary.
         @discussion This is the preferred method of finding IOService objects currently registered by IOKit. IOServiceAddNotification can also supply this information and install a notification of new IOServices. The matching information used in the matching dictionary may vary depending on the class of service being looked up.
@@ -142,17 +142,17 @@ static kern_return_t FindModems(io_iterator_t *matchingServices)
         @param existing An iterator handle is returned on success, and should be released by the caller when the iteration is finished.
         @result A kern_return_t error code. */
 
-    kernResult = IOServiceGetMatchingServices(kIOMasterPortDefault, classesToMatch, matchingServices);    
+    kernResult = IOServiceGetMatchingServices(kIOMasterPortDefault, classesToMatch, matchingServices);
     if (KERN_SUCCESS != kernResult)
     {
         printf("IOServiceGetMatchingServices returned %d\n", kernResult);
                goto exit;
     }
-        
+
 exit:
     return kernResult;
 }
-    
+
 // Given an iterator across a set of modems, return the BSD path to the first one.
 // If no modems are found the path name is set to an empty string.
 static kern_return_t GetModemPath(io_iterator_t serialPortIterator, char *bsdPath, CFIndex maxPathSize, QComboBox *box)
@@ -160,12 +160,12 @@ static kern_return_t GetModemPath(io_iterator_t serialPortIterator, char *bsdPat
     io_object_t                modemService;
     kern_return_t      kernResult = KERN_FAILURE;
     Boolean                    modemFound = false;
-    
+
     // Initialize the returned path
     *bsdPath = '\0';
-    
+
     // Iterate across all modems found. In this example, we bail after finding the first modem.
-    
+
     while ((modemService = IOIteratorNext(serialPortIterator)) && !modemFound)
     {
         CFTypeRef      bsdPathAsCFString;
@@ -181,16 +181,16 @@ static kern_return_t GetModemPath(io_iterator_t serialPortIterator, char *bsdPat
         if (bsdPathAsCFString)
         {
             Boolean result;
-            
+
             // Convert the path from a CFString to a C (NUL-terminated) string for use
                        // with the POSIX open() call.
-           
+       
                        result = CFStringGetCString((const __CFString*) bsdPathAsCFString,
                                         bsdPath,
-                                        maxPathSize, 
+                                        maxPathSize,
                                         kCFStringEncodingUTF8);
             CFRelease(bsdPathAsCFString);
-            
+
             if (result) {
                    box->addItem(bsdPath);
             }
@@ -202,7 +202,7 @@ static kern_return_t GetModemPath(io_iterator_t serialPortIterator, char *bsdPat
        
 //             (void) IOObjectRelease(modemService);
     }
-        
+
     return kernResult;
 }
 
@@ -216,4 +216,4 @@ void MainWindow::osLoadDeviceNameCombos(QComboBox *box)
   kernResult = FindModems(&serialPortIterator);
   kernResult = GetModemPath(serialPortIterator, bsdPath, sizeof(bsdPath), box);
 
-} 
+}
index 4998d8847be87b93f4746343e602485908249a09..5886a5ae2ec32f0b6df7efc0637c5d28a87d63ea 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: upgrade.cpp,v 1.9 2009-08-10 21:21:29 robertl Exp $
+// $Id: upgrade.cpp,v 1.10 2009-08-28 17:08:55 robertl Exp $
 /*
     Copyright (C) 2009  Robert Lipe, robertlipe@gpsbabel.org
 
@@ -210,7 +210,7 @@ void UpgradeCheck::httpRequestFinished(int requestId, bool error)
     information.setDefaultButton(QMessageBox::Yes);
 
     information.setText(response);
-    information.setInformativeText(tr("Do you wish do download an upgrade?"));
+    information.setInformativeText(tr("Do you wish to download an upgrade?"));
     information.setDetailedText(upgradeText);
 
     switch (information.exec()) {